<template>
	<view>
		<view class="box">
			<view class="common" @tap="$open('./user-change-password')">
				<!-- 修改密码 -->
				<view>修改密码</view>
				<image src="../../static/user/right_arr.png" mode="aspectFill"></image>
			</view>
		</view>
		<view class="box">
			<view class="common noborder" @tap="$open('./user-change-pay')">
				<!-- 修改支付密码 -->
				<view>修改支付密码</view>
				<image src="../../static/user/right_arr.png" mode="aspectFill"></image>
			</view>
		</view>
		<view class="box">
			<view class="common" @tap="$open('./font-set')">
				<!-- 聊天字体 -->
				<view>聊天字体</view>
				<image src="../../static/user/right_arr.png" mode="aspectFill"></image>
			</view>
		</view>
		<!-- 		<view class="box">
			<view class="common noborder">
				<view>群发消息</view>
				<image src="../../static/user/right_arr.png" mode="aspectFill"></image>
			</view>
		</view> -->
		<view class="box" @tap="tigaseEmptyMyMsg">
			<view class="common noborder">
				<!-- 清空所有聊天记录-->
				<view>清空所有聊天记录</view>
				<image src="../../static/user/right_arr.png" mode="aspectFill"></image>
			</view>
		</view>

		<view class="box">
			<view class="common" @tap="$open('./user-yinsi')">
				<!-- 隐私设置-->
				<view>隐私设置</view>
				<image src="../../static/user/right_arr.png" mode="aspectFill"></image>
			</view>
		</view>
		<!-- 安全设置-->
		<!-- 		<view class="box">
			<view class="common" @tap="$open('./user_safe')">
				
				<view>安全设置</view>
				<image src="../../static/user/right_arr.png" mode="aspectFill"></image>
			</view>
		</view> -->
		<!-- 允许退出APP后可以收到消息-->
		<!-- 		<view class="box">
			<view class="common noborder">
				
				<view>允许退出APP后可以收到消息</view>
				<image src="../../static/user/right_arr.png" mode="aspectFill"></image>
			</view>
		</view> -->
		<view class="center cfff btn" @tap="exit">退出当前账号</view>
	</view>
</template>

<script>
import md5 from '../../common/md5.min.js'
export default {
	data() {
		return {};
	},
	methods: {
		// 退出登录
		exit(){
			let that=this
			uni.showModal({
				title:'提示',
				content:'退出后不会删除任何历史数据,下次登录依然可以使用本账号。',
				success(e) {
					if(e.confirm){
						that.$ajax(
							that.apiList.userLogout,
							{
								areaCode:86,
								deviceKey:'android',
								telephone:md5(uni.getStorageSync('telephone'))
							},
							'GET'
						).then(res => {
							uni.clearStorageSync()
							that.$sToast('退出成功')
							that.$open('../start/login',2,1500)
						});
					}
				}
			})
		},
		tigaseEmptyMyMsg() {
			let that = this;
			uni.showModal({
				title: '提示',
				content: '确定清空所有聊天记录吗',
				success(e) {
					if (e.confirm) {
						that.$ajax(
							that.apiList.tigaseEmptyMyMsg,
							{
								type: 1
							},
							'GET'
						).then(res => {
							that.$sToast('清除成功');
							uni.removeStorageSync('list')
						});
					}
				}
			});
		}
	}
};
</script>

<style>
.btn {
	width: 700rpx;
	height: 80rpx;
	border-radius: 4rpx;
	margin: 20rpx auto;
	background: #007aff;
}
page {
	background-color: #f2f3f5;
}
view {
	color: #333;
	font-weight: 500;
	font-size: 31rpx;
}

.box {
	background-color: #fff;
}

.common {
	box-sizing: border-box;
	margin-left: 30rpx;
	height: 104rpx;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1rpx solid rgba(224, 224, 224, 1);
}

.common image {
	margin-right: 30rpx;
	width: 12rpx;
	height: 24rpx;
}

.noborder {
	margin-bottom: 20rpx;
	border: none;
}
</style>
